package com.tsh.erp.dao.hibernate.hibernate4;

import java.util.Date;

import org.springframework.stereotype.Repository;

import kiven.jee.dao.hibernate.hibernate4.BaseHibernateDao;

import com.tsh.erp.dao.SystemLoginLogDao;
import com.tsh.erp.model.Systemloginlog;
import com.tsh.erp.model.User;

@Repository("systemlogDao")
public class SystemLoginLogDaoImpl extends BaseHibernateDao<Systemloginlog, String> implements
		SystemLoginLogDao {
	@Override
	public void updateUserLoginLog(String userid, String ip, String result) {
		Systemloginlog log = new Systemloginlog();
		log.setUserip(ip);
		log.setUserid(userid);
		log.setLogintime(new Date());
		log.setStatus(result);
		
		super.save(log);
	}
	
	@Override
	public void updateUserLoginLog(User user, String ip, String result) {
		updateUserLoginLog(user.getUserid(),ip,result);
	}

	


}
